import { http } from "@/utils/http";

export type commonResult<T> = {
    code: number;
    msg: string;
    result: T;
};



/** 3.3.5 总体统计 */
export const getScreenUnitglobals = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/unity/v2/unity/global', {
        params
    });
};

/** 3.3.1设备概况（单位首页，项目首页，建筑首页，应用系统用着一个） */
export const getScreenoverview = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/unity/v2/device/overview', {
        params
    });
};

/** 3.1.3 告警统计（近7、15日告警态势）、告警分析、告警事件(单位首页、个体、应用系统、告警事件、项目主页）） */
export const getScreealarm = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/alarm', {
        params
    });
};

/** 3.1.2 实时告警 - （单位首页、告警事件、个体概览） */
export const screerealtime = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/alarm/real-time', {
        params
    });
};

/**3.1.5 工单统计 (工单处理、处理效率、工单统计，环比统计、工单处理统计) */
export const screenworkorder = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/work-order', {
        params
    });
};

/**3.1.4 巡检统计 (日常巡检) （巡检点位，巡检效率，巡检记录、巡检统计） */
export const screeninspect = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/inspect', {
        params
    });
};

/**3.3.4项目概况（应用系统） */
export const screenproject = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/unity/v2/systematic/project', {
        params
    });
};

/**3.3.6设备统计（单位主页选中应用系统/项目主页中选中应用系统）） */
export const screendevice = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/unity/v2/systematic/device', {
        params
    });
};
/**3.1.6 单位首页---项目统计（告警事件、巡检任务、工单任务） */
export const screenprojectStatistics = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/unity/project', {
        params
    });
};
/**3.4.2设施概览 */
export const screenfacilits = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/project/v2/facilit/facilit', {
        params
    });
};
/**3.4.10 (项目主页) 今日统计 */
export const screentoday = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/project/today', {
        params
    });
};

/**3.4.7 （项目主页）告警事件-》告警记录(待确认、待处理) */
export const screenprejectalarms = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/project/alarms', {
        params
    });
};

/**3.4.7 3.4.8 （项目主页）巡检任务--最近巡检 */
export const screenprejectinspects = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/project/inspects', {
        params
    });
};

/**3.4.9 （项目主页）工单任务-未处理工单 */
export const screenprejectworkorders = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/statistic/v2/project/work-orders', {
        params
    });
};


/**
 * 3.5.1设备概况-设备统计
 */

export const screenoverview = (data?: object) => {
    return http.request<commonResult<any>>("get", '/screen/personal/v2/device/over-view', {
        data
    });
}

/**
 * 3.5.2 总体统计
 */

export const screenstatisticals = (data?: object) => {
    return http.request<commonResult<any>>("get", '/screen/personal/v2/personal/statistical', {
        data
    });
}




/*
* 3.5.3 监管大屏
*/

/*
*8.1数据总览
*/
export const superviseprofam = (data?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/index/v2/pro-fam', {
        data
    });
}

/*
*8.2设备概况
*/
export const superviseoverview = (data?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/index/v2/device/overview', {
        data
    });
}
/**
 * 8.3设备统计
 * 
 */

export const supervisestatistics = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/index/v2/device/statistics', {
        params
    });
}

/*
*8.4区域统计
*/
export const superviseregion = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/index/v2/device/region', {
        params
    });
}

/*
*8.6.1 告警统计
*/
export const supervisecount = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/supervise/v2/alarm/count', {
        params
    });
}
/*
*8.6.2 告警确认
*/

export const superviseconfirm = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/supervise/v2/alarm/confirm', {
        params
    });
}
/*
*8.6.3 告警类型
*/

export const supervisealarmtype = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/supervise/v2/alarm/alarm-type', {
        params
    });
}
/*
*8.6.4 告警态势
*/

export const supervisealarmstate = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/supervise/v2/alarm/alarm-state', {
        params
    });
}
/*
*8.6.5 监管告警记录
*/
export const supervisealarmrecord = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/supervise/v2/alarm-record', {
        params
    });
}
/*

*8.6.6 告警详情
*/
export const supervisealarm = (params?: object) => {
    return http.request<commonResult<any>>("get", '/supervise/supervise/v2/alarm', {
        params
    });
}

export const Indivalarm = (params?: object) => {
    return http.request<commonResult<any>>("get", '/screen/personal/v2/alarm/personal-analysis', {
        params
    });
}